package org.example.Utils;

public class UnionResult {

    private Object body;
    private Integer code;
    private String msg;
    public UnionResult(Integer code,String msg,Object body) {
        this.code = code;
        this.msg = msg;
        this.body = body;
    }
    public static UnionResult Success(){
        return new UnionResult(200,"success",null);
    }
    public static UnionResult Success(String msg){
        return new UnionResult(200,msg,null);
    }
    public static UnionResult Success(String msg,Object body){
        return new UnionResult(200,msg,body);
    }
    public static UnionResult Failure(){
        return new UnionResult(500,"failure",null);
    }
    public static UnionResult Failure(String msg){
        return new UnionResult(500,msg,null);
    }
    public static UnionResult Failure(String msg,Object body){
        return new UnionResult(500,msg,body);
    }

    public Object getBody() {
        return body;
    }

    public void setBody(Object body) {
        this.body = body;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
